package com.wowudi.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wowudi.service.DrugRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("api/drug/record")
@RestController
public class RecordController {

    @Autowired
    DrugRecordService DrugRecordService;



    @RequestMapping("findRecordAllByDate")
    public Page findRecordAllByDate(Integer size,Integer current,String name,String ks,String js) {

        Page Page=DrugRecordService.findRecord(size,current,name    ,ks,js);
        return Page;
    }


    @RequestMapping("delDrugRecord")
    public String delDrugRecord(Integer drId){
        boolean temp= DrugRecordService.delRecordById(drId);
        if(temp)
            return "删除成功";
        else
            return "删除失败";
    }
}
